package com.ssm.exception;

public class ExceptionResult {
    /**
     * 结果码
     */
    private int code;
    /**
     * 结果码描述
     */
    private String msg;

    public ExceptionResult() {
    }
    public ExceptionResult(ResultCode resultCode){
        this.code = resultCode.getCode();
        this.msg = resultCode.getMsg();
    }

    public static ExceptionResult getInstance(ResultCode resultCode){
        return new ExceptionResult(resultCode);
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ExceptionResult{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
